
#include "RiniF.h"

string RIniFile::readStr(const string name_read_data_file) {
    read_ini(name_file+FORMAT_INI, pt);
    return pt.get<string>(name_read_data_file);
}

int RIniFile::readInt(const string name_read_data_file) {
    read_ini(name_file+FORMAT_INI, pt);
    return pt.get<int>(name_read_data_file);
}

bool RIniFile::readBool(const string name_read_data_file) {
    read_ini(name_file+FORMAT_INI, pt);
    return pt.get<bool>(name_read_data_file);
}

vector_str RIniFile::readVectorStr(const string name_read_data_file) {
    vector_str a(readInt(name_read_data_file + ".len"));
    
    FOR_SIZE_T_ONE(i, a.size(), 
        a[i] = readStr(name_read_data_file + ".key" + to_string(i)));
    
    return a;
}

vector_int RIniFile::readVectorInt(const string name_read_data_file) {
    vector_int a(readInt(name_read_data_file + ".len"));
    
    FOR_SIZE_T_ONE(i, a.size(), 
        a[i] = readInt(name_read_data_file + ".key" + to_string(i)));
    
    return a;
}
